feat: export cookie utilities from undici#742
Conversation
…eCookie and Cookie type from undici Agent-Logs-Url: https://github.com/node-modules/urllib/sessions/ff57bdc1-581c-491f-94bc-7cfe12407c04 Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com>
commit: |
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #742 +/- ##
=======================================
Coverage 94.60% 94.60%
=======================================
Files 10 10
Lines 723 723
Branches 226 226
=======================================
Hits 684 684
Misses 36 36
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This PR exposes undici’s Cookie API through urllib’s public entrypoint so consumers can use cookie parsing/serialization helpers directly from urllib, along with adding basic unit tests to verify the re-exports behave as expected.
Changes:
- Re-export undici cookie helpers (
getCookies,setCookie,getSetCookies,deleteCookie,parseCookie) fromsrc/index.ts. - Re-export undici’s
Cookietype fromsrc/index.ts. - Add tests covering the five cookie utilities and the
Cookietype import.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/index.ts |
Adds re-exports for undici cookie utilities and the Cookie type from the package entrypoint. |
test/index.test.ts |
Adds test coverage verifying the new cookie-related exports function correctly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Re-export undici's Cookie API from urllib.
getCookies,setCookie,getSetCookies,deleteCookie,parseCookiefunctions andCookietype fromsrc/index.tsWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
http://registry.npmjs.org:80/urllib/latest/opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node --experimental-import-meta-resolve --require /home/REDACTED/work/urllib/urllib/node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.1.15_@arethetypeswrong+core@0.18.2_@types+node@22.19.15__7c6ae394869a5d43fd0cf7dc1d33dc1c/node_modules/@voidzero-dev/vite-plus-test/suppress-warnings.cjs --conditions node --conditions development /home/REDACTED/work/urllib/urllib/node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.1.15_@arethetypeswrong+core@0.18.2_@types+node@22.19.15__7c6ae394869a5d43fd0cf7dc1d33dc1c/node_modules/@voidzero-dev/vite-plus-test/dist/workers/forks.js(http block)If you need me to access, download, or install something from one of these locations, you can either: